﻿﻿<template>
    <el-card class="form-container">
        <el-form :model="editForm" ref="editForm" :rules="dataRule"  @keyup.enter.native="dataFormSubmitHandle()" label-width="90px">
                                                                            <el-form-item label="行政区划代码" prop="regionCode">
                        <el-input v-model="editForm.regionCode" placeholder="请输入行政区划代码"></el-input>
                    </el-form-item>
                                                                <el-form-item label="父级id" prop="parentCode">
                        <el-input v-model="editForm.parentCode" placeholder="请输入父级id"></el-input>
                    </el-form-item>
                                                                <el-form-item label="地区名称" prop="regionName">
                        <el-input v-model="editForm.regionName" placeholder="请输入地区名称"></el-input>
                    </el-form-item>
                                                                <el-form-item label="层级" prop="regionLevel">
                        <el-input v-model="editForm.regionLevel" placeholder="请输入层级"></el-input>
                    </el-form-item>
                                                                <el-form-item label="排序号,1:省级,2:地市,3:区县" prop="regionSort">
                        <el-input v-model="editForm.regionSort" placeholder="请输入排序号,1:省级,2:地市,3:区县"></el-input>
                    </el-form-item>
                                                                <el-form-item label="显示,1:显示,0:隐藏" prop="regionStatus">
                        <el-input v-model="editForm.regionStatus" placeholder="请输入显示,1:显示,0:隐藏"></el-input>
                    </el-form-item>
                                                                <el-form-item label="备注" prop="regionRemark">
                        <el-input v-model="editForm.regionRemark" placeholder="请输入备注"></el-input>
                    </el-form-item>
                                                                <el-form-item label="创建时间" prop="createTime">
                        <el-input v-model="editForm.createTime" placeholder="请输入创建时间"></el-input>
                    </el-form-item>
                                                                <el-form-item label="修改时间" prop="updateTime">
                        <el-input v-model="editForm.updateTime" placeholder="请输入修改时间"></el-input>
                    </el-form-item>
                                        <el-form-item>
                <el-button @click="cancel">取消</el-button>
                <el-button type="primary"  @click="submit('dataForm')">确定</el-button>
            </el-form-item>
        </el-form>
    </el-card>
</template>

<script>
    import { findRegionDetail } from '@/api/admin/user'
    export default{
        name: 'user-region',
        data(){
            return {
                editForm:{
                                                                                                                    regionCode : ''
                                                                                                parentCode : ''
                                                                                                regionName : ''
                                                                                                regionLevel : ''
                                                                                                regionSort : ''
                                                                                                regionStatus : ''
                                                                                                regionRemark : ''
                                                                                                createTime : ''
                                                                                                updateTime : ''
                                                            }
            }
        },
        created(){
            this.editForm.id = this.$route.query.id
            this.view(this.$route.query.id)
        },
        methods:{
            view(val){
                findRegionDetail(val).then(res => {
                    this.editForm = res.data.responseData
            })
            },
            cancel(){
                this.$router.go(-1)
            },
            update(){

            }
        }
    }
</script>

<style>
</style>
